package com.cec.controller.admin;


import com.cec.service.admin.ActivityRegService;
import com.cec.dto.ActivityRegDTO;
import com.cec.result.Result;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 活动报名表 前端控制器
 * </p>
 *
 * @author lt
 * @since 2024-10-25
 */
@Slf4j
@RestController("adminActivityRegController")
@RequestMapping("/admin/activityReg")
public class ActivityRegController {

    @Autowired
    private ActivityRegService activityRegService;
    @GetMapping
    @ResponseBody
    @ApiOperation("分页查询活动报名列表")
    public Result pageActivityReg(ActivityRegDTO activityRegDTO){
        return activityRegService.pageQueryActivityReg(activityRegDTO);
    }

    @PutMapping
    @ApiOperation("修改报名活动信息")
    public Result updateActivityReg(@RequestBody ActivityRegDTO activityRegDTO) {
        return activityRegService.updateActivityReg(activityRegDTO);
    }

    @DeleteMapping("/logicDel/{id}")
    @ApiOperation("逻辑删除活动报名信息")
    public Result logicDeleteActivityById(@PathVariable Integer id){
        log.info("id-->{}",id);
        return activityRegService.logicDeleteActivityRegById(id);
    }

    @DeleteMapping("/logicBatchDel")
    @ApiOperation("逻辑批量删除活动报名信息")
    public Result logicBatchDeleteActivityByIds(@RequestBody List<Integer> ids){
        log.info("id-->{}",ids);
        return activityRegService.logicBatchDeleteActivityRegByIds(ids);
    }
}

